from google.appengine.ext import db
#from django import newforms as forms

class Post(db.Model):
	title = db.StringProperty(required=True)
	content = db.TextProperty()
	author = db.UserProperty()
	post_on = db.DateTimeProperty(auto_now_add=True)
	
	
	def __str__ (self):
		return '%s' %self.title
		
	def get_absolute_url (self):
		return '/post/%s' %self.key()
	
class Comments(db.Model):
	comments_post = db.ReferenceProperty(Post)
	comments_title = db.StringProperty(required=True)
	comments_content = db.TextProperty()
	comments_post_on = db.DateTimeProperty(auto_now_add=True)
